package com.cdqidi.core.weixinmanager.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 模板消息回执记录
 *
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("sys_wx_template_msg_report")
public class TemplateMsgReport extends Model<TemplateMsgReport> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "log_id", type = IdType.ASSIGN_ID)
    private String logId;
    /**
     * 模板id
     */
    @TableField("template_id")
    private String templateId;
    /**
     * 用户标识
     */
    @TableField("openid")
    private String openid;
    /**
     * 时间
     */
    @TableField("report_time")
    private LocalDateTime reportTime;
    /**
     * 消息ID:调用微信接口发送消息的时候返回
     */
    @TableField("msg_id")
    private String msgId;
    /**
     * 状态码:0表示成功
     */
    @TableField("err_code")
    private String errCode;
    /**
     * 错误消息
     */
    @TableField("err_msg")
    private String errMsg;

    public void freeData() {
        this.logId = null;
        this.templateId = null;
        this.openid = null;
        this.reportTime = null;
        this.msgId = null;
        this.errCode = null;
        this.errMsg = null;
    }

}
